#pragma once
#include "e2d/core/Component.h"
#include "e2d/core/render/CameraView.h"
#include "e2d/core/render/EntityKeyMap.h"

namespace e2d
{
	struct  CameraViewEdit :public CameraView
	{
		FXCC_DEFINE_COMPONENT_LABEL(CameraViewEdit);

		void OnLoad();

		void OnStart();

		void OnUpdate();

		CameraViewEdit();


	public:

		e2d::Entity* GetEntityByPickupIndex(int selectPickupIndex);

		void ClearPickupMap();

		void BeginPickRTT();

		void EndPickRTT() const;

		void BeginGBufferRTT();

		void EndGBufferRTT();

		// Tools 
		bool m_FreeMove{ false };

		std::map<int, e2d::Entity*> m_PickupEntityMap;

		void RegisterPickup(int id, e2d::Entity* entity);

		int m_PickupIndex{ 0 };

		std::shared_ptr<e2d::RenderTargetJack> m_PickRT;

		std::shared_ptr<e2d::RenderTargetJack> m_GBufferRT;

		e2d::EntityMap m_ParentEntity{};

		std::vector<EntityKeyMap> m_EntityKeyMaps;


	};

};